package com.learn.sb.springbootmybatis.controller;

import com.learn.sb.springbootmybatis.pojo.User;
import com.learn.sb.springbootmybatis.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/mybatis")
public class MybatisController {
	@Autowired
	private UserService userService;

	@RequestMapping("/getUser")
	@ResponseBody
	public User getUser(Integer id) {
		return userService.getUser(id);
	}
}
